<template>
	<view class="container">
		<!-- 输入框 -->
		<u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm" labelWidth="100">
			<u-form-item label="幢号/栋号" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none" placeholder="请输入幢号/栋号"
					type="number"></u--input>
			</u-form-item>
			<u-form-item label="单元号" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none" placeholder="请输入单元号"></u--input>
			</u-form-item>
			<u-form-item label="室号" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none" placeholder="请输入室号"></u--input>
			</u-form-item>
			<u-form-item label="房号" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none" placeholder="请输入房号"></u--input>
			</u-form-item>
			<u-form-item label="户型选择" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none" disabled placeholder="请选择户型"
					disabledColor="#fff"></u--input><u-icon slot="right" name="arrow-right"></u-icon>
			</u-form-item>
			<u-form-item label="楼层" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none" placeholder="请输入楼层"></u--input>
			</u-form-item>
			<u-form-item label="面积" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none" placeholder="请输入面积"></u--input>
			</u-form-item>
			<u-form-item label="房屋类型" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none" disabled disabledColor="#fff"
					placeholder="请选择"></u--input>
				<u-icon slot="right" name="arrow-down"></u-icon>
			</u-form-item>
			<u-form-item label="卧室类型" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none" placeholder="请选择卧室类型" disabled
					disabledColor="#fff"></u--input>
				<u-icon slot="right" name="arrow-down"></u-icon>
			</u-form-item>
			<u-form-item label="筛选标签" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none"></u--input>
				<u-icon slot="right" name="arrow-down"></u-icon>
			</u-form-item>
			<u-form-item label="租金" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none" placeholder="请输入租金"></u--input>
			</u-form-item>
			<u-form-item label="租赁方式" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none" placeholder="请选择租赁方式" disabled
					disabledColor="#fff"></u--input>
				<u-icon slot="right" name="arrow-down"></u-icon>
			</u-form-item>
			<u-form-item label="出租状态" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none"></u--input>
			</u-form-item>
			<u-form-item label="看房钥匙" prop="userInfo.name" borderBottom>
				<u--input v-model="model1.userInfo.name" border="none"></u--input>
				<u-icon slot="right" name="arrow-down"></u-icon>
			</u-form-item>
			<u-form-item label="图片/视频" prop="userInfo.name" borderBottom>
			 
			</u-form-item>
			<u-form-item label="看房钥匙" prop="userInfo.name" borderBottom>
				<u--textarea v-model="model1.userInfo.name" placeholder="请输入内容"></u--textarea>
			</u-form-item>
			<u-form-item label="性别" prop="userInfo.sex" borderBottom @click="showSex = true; hideKeyboard()">
				<u--input v-model="model1.userInfo.sex" disabled disabledColor="#ffffff" placeholder="请选择性别"
					border="none"></u--input>
				<u-icon slot="right" name="arrow-right"></u-icon>
			</u-form-item>
		</u--form>
		<u-action-sheet :show="showSex" :actions="actions" title="请选择性别" description="如果选择保密会报错"
			@close="showSex = false" @select="sexSelect">
		</u-action-sheet>
		<!-- 按钮 -->
	 
	</view>
</template>

<script>
	export default {
		// const formData = ref();
		data() {
			return { 
				showIndex: 0,
				houseInfo: {},
				showSex: false,
				model1: {
					userInfo: {
						name: '',
						sex: '',
					},
				},
				actions: [{
						name: '男',
					},
					{
						name: '女',
					},
					{
						name: '保密',
					},
				],
				rules: {
					'userInfo.name': {
						type: 'string',
						required: true,
						message: '请填写姓名',
						trigger: ['blur', 'change']
					},
					'userInfo.sex': {
						type: 'string',
						max: 1,
						required: true,
						message: '请选择男或女',
						trigger: ['blur', 'change']
					},
				},
				radio: '',
				switchVal: false
			}
		},
	 
		
	// const validate = async () => {
	// 	await this.$refs.form.validate();
	// };
	onReady() {
		this.$refs.uForm.setRules(this.rules)
	},
	methods: {
		async validate() {
			await this.$refs.form.validate();
		}
	}
	};
</script>

<style scoped>
	.container {
	   
		/* margin: 30rpx auto; */
	
		  
	}

	.form-group {
		margin-bottom: 1rem;
	}
</style>